var e = require;
var t = module;
var n = exports;
Object.defineProperty(n, "__esModule", {
    value: !0
});
var o = e("GIFSprite"),
i = cc._decorator,
a = i.ccclass,
r = i.property,
s = function(e) {
    __extends(t, e);
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        t.pNode = null;
        t.image = null;
        t.nameLabel = null;
        t.curData = null;
        return t
    }
    t.prototype.setData = function(e) {
        this.curData = e;
        this.showData()
    };
    t.prototype.showData = function() {
        if (SDK.Util.Helper.isGif(this.curData.imageUrl)) { (e = this.image.getComponent(o.default)) || (e = this.image.addComponent(o.default));
            e.path = this.curData.imageUrl
        } else {
            var e; (e = this.image.getComponent(o.default)) && e.clear();
            SDK.Util.Helper.loadImage(this.image, this.curData.imageUrl)
        }
        this.nameLabel && (this.nameLabel.string = this.curData.name);
        this.pNode.active = !0;
        this.pNode.stopAllActions();
        SDK.Mgr.Inst.event("PromoShow_" + this.curData.key)
    };
    t.prototype.click = function() {
        SDK.Mgr.Inst.event("PromoClick_" + this.curData.key);
        SDK.Mgr.Inst.promo(this.curData,
        function() {})
    };
    __decorate([r(cc.Node)], t.prototype, "pNode", void 0);
    __decorate([r(cc.Sprite)], t.prototype, "image", void 0);
    __decorate([r(cc.Label)], t.prototype, "nameLabel", void 0);
    return __decorate([a], t)
} (cc.Component);
n.default = s